//控制器
//$scope          控制器作用域
//$http           服务处理
//$stateParams    参数解析 /about/:id
//$location       路径处理
//$rootScope      根作用域 
app.controller('democtrl',['$scope', '$http', '$stateParams', '$location', '$rootScope','$compile' , function($scope, $http, $stateParams, $location, $rootScope,$compile ) {
	$scope.aa = "John";
	$scope.subfun = function(){
		var regconfig=[
          	{eleinput:"r1",eletext:"r1s",rule:[{reg:/^.+$/,text:'不能为空'}]},
			{eleinput:"r2",eletext:"r2s",rule:[{reg:/^.+$/,text:'不能为空'}]}
        ];
	    emaJgl.submitValidate(
	        regconfig,
	        {
	          funsubmit:function(){//验证通过可提交回调   
	            
	            //信息提交接口
	            alert("成功");

	          },
	          funerr:function(){//不可提交回调

	          },
	          funerrlist:function(errlist){
	            $('#'+ errlist[0]).focus();
	          } 
	        }
	    );
	};
	//jq load
	$scope.aaa = "aaa";
	
	$scope.bbb = "bbb";
	$scope.num = 0;
	$scope.add = function(){
		$scope.num+=1;
	};
	setTimeout(function(){
		$scope.settime=456;
		$scope.$apply();
	},500);
	
	
    $("#jqload").load("load.html",function(){
    	var el=$compile($("#jqload").html())($scope); 
    	$("#jqload").html(el);
    	$scope.$apply();
    });
    
    
	//end
}]);
